package com.holly.unit.kafka.exception.enums;

import com.holly.unit.core.exception.AbstractExceptionEnum;
import com.holly.unit.kafka.constants.KafkaConstants;
import lombok.Getter;

/**
 * kafka 消息队列失败
 *
 * @author holly
 * @date 2020/10/23 17:36
 */
@Getter
public enum KafkaExceptionEnum implements AbstractExceptionEnum {

    /**
     * kafka 发送消息失败
     */
    KAFKA_MQ_SEND_ERROR(KafkaConstants.KAFKA_EXCEPTION_STEP_CODE, "kafka发送消息失败"),
    
    /**
     * kafka 接受消息失败
     */
    KAFKA_MQ_RECEIVE_ERROR(KafkaConstants.KAFKA_EXCEPTION_STEP_CODE, "kafka接收消息失败"),
    KAFKA_MQ_TOPIC2TOPIC_ERROR(KafkaConstants.KAFKA_EXCEPTION_STEP_CODE, "kafka接收topic并"),
    
    /**
     * kafka 元数据失败
     */
    KAFKA_MQ_METADATA_ERROR(KafkaConstants.KAFKA_EXCEPTION_STEP_CODE, "kafka获取元数据失败:{}:{}");

    /**
     * 错误编码
     */
    private final String errorCode;

    /**
     * 提示用户信息
     */
    private final String userTip;

    KafkaExceptionEnum(String errorCode, String userTip) {
        this.errorCode = errorCode;
        this.userTip = userTip;
    }

}
